
package hojat6;

/**
 *
 * @author Juan Pablo
 */
public class node
{
    int frequency; // frequency of char
    char ch;    // the character

    public node(int freq)
    // post: construct entry with frequency freq
    {
        ch = 0;
        frequency = freq;
    }

    public node(char c)
    // post: construct character entry with frequency 1
    {
        ch = c;
        frequency = 1;
    }

    public boolean equals(Object other)
    // post: return true if leaves represent same character
    {
        node that = (node)other;
        return this.ch == that.ch;
    }
    
    public char getChar(){
        return ch;
    }
    
    public int getFrequency(){
        return frequency;
    }
    
    public void incrementarFrec(){
        frequency++;
    }
}
